package org.huangxiaozhe.adventure;


import java.util.ArrayList;
/**
 * 
 * �����ҷ��ɻ��������ƶ�����ƶ��߳�
 *
 */
public class MoveThread extends Thread{
	
	private int sleepSpan = 30;//˯�ߵĺ�����
	public boolean flag = false;//ѭ����־λ 
	GameView gameView;//GameView������
	
	public MoveThread(GameView gameView){//������
		this.gameView = gameView;
	}
	public void setFlag(boolean flag){
		this.flag = flag;
	}
	public void run(){
		while(flag){
			if(gameView.init){
				gameView.Move();
			}
			try{//˯����Ϣ
				Thread.sleep(sleepSpan);
			}catch(Exception e){
				e.printStackTrace();
			}
		}
	}
	public void Stop() {
		setFlag(false);
	}
}